package com.itheima.Jiuye11;

import java.io.FileOutputStream;
import java.io.IOException;

public class OutputTest {
    public static void main(String[] args) throws IOException {
      //  mather();
        //return;
        //mather1();
       // return;
        //mather2();
//        return;
    }

    private static void mather2() throws IOException {       //write 3个参数的方法，（数组，从第几个索引开始，写多少个）
        FileOutputStream out = new FileOutputStream("mJiuye\\a.txt");
        byte[] a = {97,98,99,100,101,102};
        out.write(a,3,3);
        out.close();
    }

    private static void mather1() throws IOException {   //写多个数据
        FileOutputStream out = new FileOutputStream("mJiuye\\a.txt");
        byte[] a = {97,98,99,100};
        out.write(a);
        out.close();
    }

    private static void mather() throws IOException {             //写单个数据
        FileOutputStream out = new FileOutputStream("mJiuye\\a.txt");
        out.write('a');
        out.close();
    }
}
